package com.lkx.farmershop.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * (Tuan)实体类
 *
 * @author makejava
 * @since 2025-01-21 19:40:31
 */
@Getter
@Setter
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Tuan implements Serializable {
    private static final long serialVersionUID = -73177735899793999L;
    /**
     * 组团id
     */
    @TableId
    private Long tuanId;
    /**
     * 发布人的id
     */
    private Long userId;
    /**
     * 组团标题
     */
    private String tuanTitle;
    /**
     * 组团内容
     */
    private String tuanDetail;
    /**
     * 组团状态：0：未发布，1：进行中，2：已完成
     */
    private Integer tuanStatus;
    /**
     * 组团所需人数（不算组团发起人）
     */
    private Integer requiredPeople = 10;
    /**
     * 已加入组团人数（不算组团发起人）
     */
    private Integer joinPeople = 0;
    /**
     * 组团发布时间
     */
    private LocalDateTime sendTime;
    /**
     * 加入该组团是否需发布者同意
     */
    private Boolean needAgree = false;
    /**
     * 申请加入时的提问
     */
    private String question;
    /**
     * 组团人数达到需要人数时，是否自动结束组团
     */
    private Boolean autoEnd = false;
    /**
     * 浏览量
     */
    private Integer viewCount = 0;
    /**
     * 点赞量
     */
    private Integer upvoteCount = 0;
    /**
     * 组团开始时间
     */
    private LocalDateTime beginTime = LocalDateTime.now();
    /**
     * 组团结束时间
     */
    private LocalDateTime endTime = LocalDateTime.now().plusDays(1);
    /**
     * 组团地点
     */
    private String location = "";
    /**
     * 组团地点经度
     */
    private Double longitude = 0.0;
    /**
     * 组团地点纬度
     */
    private Double latitude = 0.0;

    public Tuan(Long userId, String tuanTitle, String tuanDetail, Integer tuanStatus, Integer requiredPeople, Integer joinPeople, LocalDateTime sendTime, Boolean needAgree, String question, Boolean autoEnd) {
        this.userId = userId;
        this.tuanTitle = tuanTitle;
        this.tuanDetail = tuanDetail;
        this.tuanStatus = tuanStatus;
        this.requiredPeople = requiredPeople;
        this.joinPeople = joinPeople;
        this.sendTime = sendTime;
        this.needAgree = needAgree;
        this.question = question;
        this.autoEnd = autoEnd;
    }
}

